package com.gaber.test;

import com.gaber.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextTest1 {
    public static void main(String[] args) {

        //指定环境
//        System.setProperty("spring.profiles.active","dev");

        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
//        UserService userService = (UserService) applicationContext.getBean("userService");
//        System.out.println("userService"+userService);
//        applicationContext.close();

        UserService userService = (UserService) applicationContext.getBean("aaa");
//        UserDao userDao = (UserDao) applicationContext.getBean("userDao");

        userService.show();
//        System.out.println(userDao);

    }
}
